<?php 

function console($message, $type = 'log') {

    echo "<script>console.{$type}({$message})</script>";

}